# -*- coding: utf-8 -*-
'''
	环境变量
    pip install python-dotenv
'''
import uvicorn
import os
from fastapi import FastAPI
from example05.config import get_config

app = FastAPI()

@app.get("/")
def index():
    settings = get_config()
    return "应用名称：%s，版本号：%s, 调试模式：%s" % ( settings.PROJECT_NAME, settings.VERSION, os.getenv("DEBUG","???")  )

if __name__ == '__main__':

    uvicorn.run(
        app     = 'example05-环境变量:app', 
        host    = "0.0.0.0", 
        port    = 8080, 
        reload  = True
    )